package cn.getech.data.metadata.model.res;

import cn.getech.data.metadata.entity.meta.CollectionTask;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;

@ApiModel(description = "采集任务详情请求")
@Data
public class CollectionTaskDetail {
    private Long id;

    /**
     * 任务名称
     */
    private String taskName;
    /**
     * 0 手动采集 1自动采集
     */
    @ApiModelProperty(value = "0 手动采集 1自动采集")
    private Integer taskType;

    /**
     * 所属系统id
     */
    private Integer ownSystem;

    /**
     * 所属模块id
     */
    private Integer ownModule;

    /**
     * 更新人
     */
    private Long updateUser;
    private String updateUserName;

    /**
     * 导入方式 0 增量 1 全量
     */
    private Integer exportType;
    @ApiModelProperty(value = "初始化角色")
    private String roleName;

    @ApiModelProperty(value = "调度方式 1:正常 2:暂停")
    private Integer scheduleEnable;

    @ApiModelProperty(value = "数据源名称")
    private String sourceName;
    @ApiModelProperty(value = "主机")
    private String sourceHost;
    @ApiModelProperty(value = "端口")
    private String port;
    @ApiModelProperty(value = "用户名")
    private String user;
    @ApiModelProperty(value = "数据库名称")
    private String dbName;

    @ApiModelProperty(value = "循环方式 1:定时运行 2:循环运行")
    private Integer scheduleMode;
    @ApiModelProperty(value = "调度单位 循环方式为循环运行 1:每小时 2:每日 3:每周 4:每月 ")
    private Integer scheduleUnit;
    @ApiModelProperty(value = "循环方式间隔 调度方式值")
    private Integer intervalValue;

    @ApiModelProperty(value = "循环方式定时 分")
    private Integer scheduleMinute;
    @ApiModelProperty(value = "循环方式定时 时")
    private Integer scheduleHour;
    @ApiModelProperty(value = "循环方式定时 天或者周")
    private Integer scheduleDay;

    @ApiModelProperty(value = "数据源类型")
    private String sourceType;

    @ApiModelProperty(value = "所属系统名称")
    private String systemName;

    @ApiModelProperty(value = "所属模块名称")
    private String moduleName;

    @ApiModelProperty(value = "所属模块负责人")
    private String moduleUsername;



    public CollectionTaskDetail() {
    }
    /**
     * 目录id
     */
    @TableField(exist = false)
    private List<String> categoryIdsList;

    public CollectionTaskDetail(CollectionTask record) {
        this.id = record.getId();
        this.taskName = record.getTaskName();
        this.taskType = record.getTaskType();
        this.ownSystem = record.getOwnSystem();
        this.ownModule = record.getOwnModule();
        this.updateUser = record.getUpdateUser();
        this.exportType = record.getExportType();
        this.categoryIdsList = record.getCategoryIdsList();
    }
}
